<?php
class module_index{
	function actionIndex(){
		echo $this->relativePath('D:/php/htdocs/7blog/admin','D:/php/htdocs/7blog/content/themes/default');
		//include m()->tpl('test');
	}
	
	function relativePath($basePath,$path){
		$rBasePath=$basePath;
		while($rBasePath!=substr($path,0,strlen($rBasePath))||$rBasePath=='/'){
			$rBasePath = dirname($rBasePath);
		}
		if($rBasePath!=$basePath){
			$temp = str_replace($rBasePath,'',$basePath);
			while($temp!=DIRECTORY_SEPARATOR){
				$per = '../';
				$temp = dirname($temp);
			}
		}
		return $per.trim(str_replace($rBasePath,'',$path),'/');
	}
}